package com.cola;

import java.util.Arrays;

/**
 * @Grup:com.hxh
 * @Auther:cola
 * @Data:2021/3/9-2021-03-18:28
 * @version:1.0
 */
public class StringDemo2 {
    public static void main(String[] args) {
        String str="   afafafafacagfa4f";
        char c=str.charAt(1);
        System.out.println(c);

        System.out.println(str.toCharArray());
        char[]cs={'a','b','c'};
        String s1=new String(cs);
        System.out.println(s1);

        String s2=new String(cs,0,1);
        System.out.println(s2);

        System.out.println(Arrays.toString(str.getBytes()));

        System.out.println(str.replace("a","!"));
        System.out.println(str.replace("ag","r"));
        System.out.println(str.replaceAll("\\d","rec"));
        System.out.println(str.isEmpty());
        System.out.println(str.lastIndexOf("@"));
        System.out.println(str.indexOf("f"));
        System.out.println(str.length());
        System.out.println(str.trim());
        System.out.println(str.concat("_____"));
        System.out.println(String.valueOf(10));
    }


}
